<?php
	$owner_guid=$vars['owner']->guid;

	$pel= get_entities("object","pel",$owner_guid);

	$pel=$pel[0];
	$guid=$pel->guid;
	
	if(!empty($pel)){
		
  $title_label= elgg_echo('pel:native')." :";
  $lang='<h4><img src="'.$vars['url'].'_graphics/owner_block_menu_arrow.gif" alt="owner block menu" />'.'  '.$pel->description.'</h4>';;
  $ent = get_entities_from_metadata('parent_guid',$guid,"object",'lang');
  $otherlang=elgg_echo('pel:friend:nolang');
  
	if(is_array($ent)){
		foreach($ent as $e){
			$otherlang=elgg_echo('pel:otherlang');
			$entity=get_entity($e->guid);
			$guid=$entity->guid;
			$text.= '<tr><td><img src="'.$vars['url'].'mod/uvsq/graphics/owner_block_menu_arrow.gif" alt="owner block menu" /></td><td><h4>'.$entity->description.' <a href="'.$vars['url'].'mod/pel/viewlang.php?lang='.$entity->getGUID().'"><img src="'.$vars['url'].'mod/pel/graphics/voir.gif" alt="voir"/> Voir </a></h4></td></tr>';
		}

	}
	else{
		$otherlang=elgg_echo('pel:otherlang');
		$text=elgg_echo('pel:friend:nolang');
	}
?>
<div class="pel">
	<p>
		<h3><?php echo $title_label; ?></h3>
		<?php echo $lang; ?>
	</p>
	<p>
		<h3><?php echo $otherlang ; ?>: </h3>
	</p>
	<p>
		<table id="tablang">
			<?php echo $text; ?>
		</table>
	</p>
</div>
<?php

	}
	else
	echo '<div class="pel">Non renseigné</div>';
	
	?>
